<template>
  <div>
    <ocean :use="template" class="theme_box"></ocean>
  </div>
</template>
<script lang="tsx" setup>
import { useTableTemplate } from '@/ocean';
import { EnterpriseAPI, GlobalAPI } from '@/app/api';
import { ref } from 'vue';

type Column = {
  createTime: "2022-08-30 17:28:02"
  enterpriseName: "欧唯特"
  enterpriseType: "F"
  id: 56
  updateTime: "2022-08-30 17:28:02"
  workerName: "马云"
  workerPhone: "1234567890"
}

enum Type {
  'F' = '福利型',
  'K' = '开放型',
}

const template = useTableTemplate<Column>('企业员工列表', {
  query: data => EnterpriseAPI.queryStaffList(data).then(({ data, total }) => {
    template.table.setData(data);
    template.pagination.setCount(total);
  })
});


template.form.item('员工姓名', 'workerName').input()
template.form.item('员工手机号', 'workerPhone').input()
template.form.item('企业名称', 'enterpriseName').input()

template.table.column('员工姓名', 'workerName');
template.table.column('员工手机号', 'workerPhone');
template.table.column('企业名称', 'enterpriseName');
template.table.column('企业类型', 'enterpriseType').enums(Type);
template.table.column('创建时间', 'createTime');

template.query()
</script>